<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width">
    <title></title>


    <!-- compiled css output -->
    <link href="css/ionic.app.css" rel="stylesheet">
    <!-- ionic/angularjs js -->
    <script src="lib/ionic/js/ionic.bundle.js"></script>

    <!-- cordova script (this will be a 404 during development) -->
    <script src="cordova.js"></script>

    <!-- your app's js -->
    <script src="js/app.js"></script>
    <script src="js/ng_input_select.js"></script>
    <script src="js/ng_ydzbase.js"></script>
    <script src="js/ng_localstorage.js"></script>
    <script src="js/md5.js"></script>
  </head>
  <body ng-app="starter">
    <ion-pane ng-controller="YdzCtrl">
      <ion-header-bar class="bar-stable">
        <img class="left-image" src="img/logo.png" alt="">
        <h1 class="title">LESS & MORE</h1>
        <div class="buttons">
          <button class="button button-light"
          ng-click="showModal()">重新登陆</button>
        </div>
      </ion-header-bar>
      <ion-content>
        <div class="item select_city">
          <span>选择城市：</span>
          <select ng-model="customer.City"
            ng-options="c for c in CityList"></select>
        </div>
        <ion-list class="customer_info">
          <ion-item class="item-input">
            <input type="text" ng-model="customer.Name"
            placeholder="用户名"></ion-item>
          <ion-item class="item-input">
            <input type="text" ng-model="customer.Tel"
            placeholder="用户电话"></ion-item>
          <ion-item class="item-input">
            <textarea type="text" ng-model="customer.Addr"
            placeholder="用户地址">
            </textarea>
          </ion-item>
        </ion-list>
        <ion-list class="saler_info">
          <ion-item class="item-input item-stacked-label">
            <span class="input-label">销售：</span>
            <select ng-model="employee.Saler" ng-options="l.NickName for l in salerList">
            </select>
          </ion-item>
          <ion-item class="item-input item-stacked-label">
            <span class="input-label">量体师：</span>
            <select ng-model="employee.Tailor"
              ng-options="l.NickName for l in tailorList"
            ></select>
          </ion-item>
          <ion-item class="item-input">
            <textarea type="text" ng-model="customer.Note"
            placeholder="备注">
            </textarea
          </ion-item>
        </ion-list>
        <div class="sect orders">
          <div class="bar bar-positive">
            <button class="button button-icon ion-ios-minus-outline"
             ng-click="switchDelete()"></button>
            <h2 class="title">订单列表</h2>
            <button class="button button-icon ion-ios-plus-outline"
            side="right"
            ng-click="addOrder()"></button>
          </div>
          <ion-list show-delete="showDelete">
            <ion-item ng-repeat="(i,o) in Orders track by $index")
            one-order order_id="{{i}}">
              <ion-delete-button class="ion-minus-circled"
                ng-click="delOrder(i)"
              ></ion-delete-button>
              <label class="item item-input">
                <span>品类：</span>
                <select ng-model="o.SuitType"
                  ng-options="o for o in ProductsList"></select>
              </label>
              <label class="item item-input">
                <span>面料：</span>
                <select ng-model="o.FabricBrand"
                  ng-change="FabricChanged(i)"
                ng-options="o for o in FabricList"></select>
              </label>
              <!-- 不能用label！ -->
              <div class="item item-input item-input-select">
                <span>面料册：</span>
                <input_select ng-model="o.FabricBook"
                  ng-change="FabricBookChanged(i)"
                  options="o.FabricBookList"></input_select>
              </div>
              <div class="item item-input item-input-select">
                <span>面料范围：</span>
                <input_select ng-model="o.FabricRange"
                options="o.FabricRangeList"> </input_select>
              </div>
              <label class="item item-input">
                <span>面料号：</span>
                <input type="text" ng-model="o.FabricNumber">
              </label>

              <label class="item item-input">
                <span>单价：</span>
                <input type="number" ng-model="o.Price"
                 disabled="disabled">
              </label>
              <label class="item item-input">
                <span>数量：</span>
                <input type="number" ng-model="o.Count">
              </label>
              <label class="item item-input">
                <span>折扣：</span>
                <input type="number" ng-model="o.Discount">
              </label>
              <label class="item item-input">
                <span>惠减：</span>
                <input type="number" ng-model="o.PayMinus">
              </label>
            </ion-item>
          </ion-list>
        </div>
      </ion-content>
      <ion-footer-bar align-title="center" class="bar-energized">
        <button class="button button-assertive ion-card"
          side="left"
          ng-click="payOrders('0')">刷卡</button>
        <h5 class="title" ng-bind="'￥' + TotalSum"></h5>
        <button class="button button-assertive ion-ios-barcode"
          side="right"
          ng-click="payOrders('1')">扫码</button>
      </ion-footer-bar>
    </ion-pane>
  </body>
</html>
